import ajax from '@/utils/ajax'
import dialog from '@/utils/dialog'
export default function (query) {
  return ajax({
    url: `/f/area/listData?parentCode=${query.id}`,
    data: {
      parentCode: query.id
    },
    barLoading: true
  }).then(data => {
    const arr = data.map(v => {
      return {
        areaCode: v.areaCode,
        areaName: v.areaName
      }
    })
    return arr
  }).catch(msg => dialog.showToast(msg || '请求失败'))
}
